package com.fm.parser.excel;

import java.util.Collection;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;

public abstract class ExcelRowReaderBase<T extends Map<String, Object>> implements ExcelRowReader<T> {
	@Override
	public abstract void doOtherRow(int rowNumber, T map);

	@Override
	public void doFirstRow(Collection<String> row) {
		Set<String> set = new HashSet<>();
		for (String head : row) {
			if (!set.add(head)) {
				throw new RuntimeException("重复的表头:" + head);
			}
		}
	}
}
